#pragma once
//#include "SFML\Graphics.hpp"
#include <ctime>
#include <iostream>

namespace game
{

class FrameRateManager
{
	int _frame_rate;
	//sf::Clock * _clock;
	clock_t _clock;
	double _dt;
	double _average_wait;

public:
	FrameRateManager(int frame_rate)
	{
		_clock = clock();//new sf::Clock();
		_frame_rate = frame_rate;
		_dt = 1.00 / (double)_frame_rate;
	}
	~FrameRateManager()
	{
		//delete  _clock;
	}
	float get_delta() const
	{
		return _dt;
	}

	void Wait() 
	{
		while(clock() - _clock < _dt * 1000){}
		std::cout << 1000.0  / (clock() - _clock )<< " ms " << std::endl;
		_clock = clock();
		/*while(_clock->getElapsedTime().asMilliseconds() < _dt*1000){}
		_clock->restart();*/
	}
};


}